import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart';
// import 'package:fluwx/fluwx.dart';
import 'package:mall/config/routers.dart';
import 'package:mall/config/application.dart';
import 'package:mall/model/user_info.dart';
import 'package:provider/provider.dart';



void main() {




  runApp(MultiProvider(
    providers: [
      ChangeNotifierProvider(create: (_) => UserInfoModel()),
    ],
    // builder: (context) => UserInfoModel(),
    child: MallApp(),
  ));

  registerWxApi(
    appId: "wx05dd50e347d8823f",
    doOnAndroid: true,
    doOnIOS: true,
    universalLink: "https://qyvideo.gdiu.cn/",
  );
}

class MallApp extends StatelessWidget {
  MallApp() {
    final router = FluroRouter();
    Routers.configureRoutes(router);
    Application.router = router;
  }

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      designSize: Size(750, 1334),
      builder: () =>  MaterialApp(
        debugShowCheckedModeBanner: false,
        onGenerateRoute: Application.router.generator,
        theme: ThemeData(
          appBarTheme: AppBarTheme(
            color: Colors.deepOrangeAccent,
            elevation:0,
            centerTitle: true
          ),
          primaryColor: Colors.deepOrangeAccent,
        ),
      ),
    );
  }
}
